﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/ICeFramework.Common.DataLayer" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/ICeFramework.Common.DataLayer" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="http://schemas.datacontract.org/2004/07/System.Data" />
  <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
  <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <xs:import namespace="http://schemas.datacontract.org/2004/07/ICeFramework.Common.DataLayer.Enums" />
  <xs:complexType name="EntityFilter">
    <xs:sequence>
      <xs:element minOccurs="0" name="Column" nillable="true" type="tns:EntityColumn" />
      <xs:element minOccurs="0" name="Expression" nillable="true" type="xs:anyType" />
      <xs:element minOccurs="0" name="Filter1" nillable="true" type="tns:EntityFilter" />
      <xs:element minOccurs="0" name="Filter2" nillable="true" type="tns:EntityFilter" />
      <xs:element minOccurs="0" name="Operator" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="_parameters" nillable="true" type="tns:DataParameterCollection" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="EntityFilter" nillable="true" type="tns:EntityFilter" />
  <xs:complexType name="EntityColumn">
    <xs:sequence>
      <xs:element minOccurs="0" name="Validation" type="tns:ValidationFlags" />
      <xs:element minOccurs="0" name="_allowNull" type="xs:boolean" />
      <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/System.Data" minOccurs="0" name="_dbType" type="q1:DbType" />
      <xs:element minOccurs="0" name="_defaultValue" nillable="true" type="xs:anyType" />
      <xs:element minOccurs="0" name="_displayName" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="_isForeignKey" type="xs:boolean" />
      <xs:element minOccurs="0" name="_isInPrimaryKeys" type="xs:boolean" />
      <xs:element minOccurs="0" name="_isReadOnly" type="xs:boolean" />
      <xs:element minOccurs="0" name="_length" nillable="true" type="xs:int" />
      <xs:element minOccurs="0" name="_name" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="_precision" nillable="true" type="xs:int" />
      <xs:element minOccurs="0" name="_scale" nillable="true" type="xs:int" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="EntityColumn" nillable="true" type="tns:EntityColumn" />
  <xs:simpleType name="ValidationFlags">
    <xs:list>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="None">
            <xs:annotation>
              <xs:appinfo>
                <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">0</EnumerationValue>
              </xs:appinfo>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="Mandatory">
            <xs:annotation>
              <xs:appinfo>
                <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</EnumerationValue>
              </xs:appinfo>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="Length">
            <xs:annotation>
              <xs:appinfo>
                <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">2</EnumerationValue>
              </xs:appinfo>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="Custom">
            <xs:annotation>
              <xs:appinfo>
                <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">4</EnumerationValue>
              </xs:appinfo>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:list>
  </xs:simpleType>
  <xs:element name="ValidationFlags" nillable="true" type="tns:ValidationFlags" />
  <xs:complexType name="DataParameterCollection">
    <xs:sequence>
      <xs:element xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="_parameters" nillable="true" type="q2:ArrayOfKeyValueOfanyTypeanyType" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="DataParameterCollection" nillable="true" type="tns:DataParameterCollection" />
  <xs:complexType name="EntityOrder">
    <xs:sequence>
      <xs:element minOccurs="0" name="_column" nillable="true" type="tns:EntityColumn" />
      <xs:element xmlns:q3="http://schemas.datacontract.org/2004/07/ICeFramework.Common.DataLayer.Enums" minOccurs="0" name="_direction" type="q3:EntityOrderDirection" />
      <xs:element minOccurs="0" name="_innerOrder" nillable="true" type="tns:EntityOrder" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="EntityOrder" nillable="true" type="tns:EntityOrder" />
  <xs:complexType name="StoredProcedureDefinition">
    <xs:sequence>
      <xs:element name="_parameters" nillable="true" type="tns:DataParameterCollection" />
      <xs:element name="_storedProcedureName" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StoredProcedureDefinition" nillable="true" type="tns:StoredProcedureDefinition" />
</xs:schema>